<?php
/**
 * Created by PhpStorm.
 * User: ly
 * Date: 2018\2\1 0001
 * Time: 9:31
 */
use yii\widgets\LinkPager;
use backend\controllers\DtActionFilter;
if($is_highlights!=1){
//    Yii::$app->session['is_highlights']='turnoff.png';
    $highlightsPic='turnoff.png';
}else{
//    Yii::$app->session['is_highlights']='turn.png';
    $highlightsPic='turn.png';
}
//$projectListDYArray
$IsFirstMortgage=Yii::$app->params['IsFirstMortgage'];//是否首押  1是 2否
$IsFirstSeal=Yii::$app->params['IsFirstSeal'];//是否首封  1是 2否
?>

<style type="text/css">
    #myTable2 tr th{background: #e8f4fe!important;}
    #myTable2 tr:hover{background: #e8f4fe;}
    #myTable2 tr:hover td input{background: #e8f4fe;}
    #myTable2 tr td{border-bottom: 1px solid #eeeeee;}
    #myTable2 {min-width: 100%;}
</style>

<div id="projectListBase2" class="table-responsive  table-responsive-notedit clearfix" style=" border: 1px solid #eeeeee; max-height: 529px;">
    <table class="fancyTable guarantee-table"  id="myTable2"  style="border: none;">
        <thead style="background: #e8f4fe;">
        <tr>
            <th class="text-center">序号#</th>
            <th class="text-left">借款人</th>
            <th class="text-left">城市</th>
            <th class="text-left">本金（元）</th>
            <!--<基本信息>-->
            <th class="text-left sy1">利息（元）</th>
            <th class="text-left sy1">本息合计</th>
            <th class="text-left sy1">诉讼状态</th>
            <th class="text-left sy1">借款人状况</th>
            <th class="text-left sy1">企业类型</th>
            <th class="text-left sy1">行业</th>
            <th class="text-left sy1">保证人/抵押人</th>
            <th class="text-left sy1">担保方式</th>
            <th class="text-left sy1">保证人状况</th>
            <th class="text-left sy1">抵押物详情描述</th>
            <!--<司法进展>-->
            <th class="text-left sy2">判决</th>
            <th class="text-left sy2">执行</th>
            <th class="text-left sy2">法院</th>
            <th class="text-left sy2">列失信</th>
            <!--<抵押物1：N>-->
            <th class="text-left sy3">抵押本金（元）</th>
            <th class="text-left sy3">抵押利息（元）</th>
            <th class="text-left sy3">抵押物类型</th>
            <th class="text-left sy3">权属人</th>
            <th class="text-left sy3">他项权证号</th>
            <th class="text-left sy3">建筑面积（平米）</th>
            <th class="text-left sy3">土地面积（平米）</th>
            <th class="text-left sy3">最高抵押额度（元）</th>
            <th class="text-left sy3">剩余使用年限</th>
            <!--<抵押查封1：N>-->
            <th class="text-left sy3">抵押物抵押顺序</th>
            <th class="text-left sy3">是否首押</th>
            <th class="text-left sy3">后续抵押情况</th>
            <th class="text-left sy3">抵押情况描述</th>
            <th class="text-left sy3">抵押物查封顺序</th>
            <th class="text-left sy3">是否首封</th>
            <th class="text-left sy3">抵押物查封情况</th>
            <!--<抵押物价值评估1：N>-->
            <th class="text-left sy3">抵押物变现价保守</th>
            <th class="text-left sy3">抵押物变现价激进</th>
            <th class="text-left sy3">抵押物定价依据</th>
            <!--<非抵押评估>-->
            <th class="text-left sy6">非抵押物的回收亮点分析</th>
            <th class="text-left sy6">非抵押部分回收（保守）</th>
            <th class="text-left sy6">非抵押部分回收（乐观）</th>
            <th class="text-left sy6">非抵押物查封顺序</th>
            <th class="text-left sy6">非抵押物查封情况</th>
            <!--<回现评估>-->
            <th class="text-left sy7">回现保守</th>
            <th class="text-left sy7">回现激进</th>
            <th class="text-left sy7">过户税费</th>
            <th class="text-left sy7">回现周期（月）</th>
            <th class="text-left sy7">回现分析</th>
        </tr>
        </thead>
        <tbody>
        <?php
        $i=0;
        if(count($projectListDY)>0) {
            $managementStatus = Yii::$app->params['managementStatus'];//借款人状况
            $projectEnterprise = Yii::$app->params['project_enterprise'];//企业
            $industrys=Yii::$app->params['industrys'];//行业
            $is_suit=Yii::$app->params['isSuit'];
            $mortgageTypes3=Yii::$app->params['mortgageTypes3'];//抵押物类型（抵押表）
            foreach($projectListDY as $val){
                $i++;
                $industryStr='';//行业字符串
                if(empty($val['industry'])){
                    $industryStr='--';
                }else{
                    $industryIDs=explode(',',$val['industry']);
                    foreach($industryIDs as $value){
                        if(!empty($industryStr)){
                            $industryStr.=',';
                        }
                        $industryStr.=$industrys[$value]['name'];
                    }
                }
                $rowspanStr='';//合并列
                if(count($val['mortgage'])>0){
                    $rows=0;
                    foreach($val['mortgage'] as $seal){
                        $rows+=count($seal['seal'])>1?count($seal['seal']):1;
                    }
                    $rowspanStr='rowspan="'.$rows.'"';
                }
                $star='';
                if($val['is_highlights']==1){
                    $star='<img src="/image/assetPackage/star.png" class="pull-left">';
                }
                echo '<tr class="text-left" >
                    <td '.$rowspanStr.'>
                        <div class="clearfix" style="">
                            <input type="checkbox" value="'.$val['id'].'" class="pull-left list-input">' . $i . '
                        </div>
                    </td>
                    <td  '.$rowspanStr.' class="clearfix" style="width : 110px;"><div class="clearfix">'.$star.'<span style="width: 120px;display: block;" class="pull-left"><a target="_blank" href="/project/getinfodata?package_id='.$val['package_id']."&project_id=".$val['id'].'" class="txt-cut" title="' .$val['borrower'] . '">' .$val['borrower'] . '</a><span></div></td>
                    <td '.$rowspanStr.' title="' .$val['provinceName']['title'] .$val['cityName']['title'] . '"><div style="width:100px;">' .$val['provinceName']['title'] .$val['cityName']['title'] . '</div></td>
                    <td '.$rowspanStr.'><input type="text" value="' .Yii::$app->formatter->asDecimal($val['principal']) . '" disabled ></td>
                    <td '.$rowspanStr.' class="sy1"><input type="text" value="' .Yii::$app->formatter->asDecimal($val['interest']) . '" disabled></td>
                    <td '.$rowspanStr.' class="sy1"><input type="text" value="' .Yii::$app->formatter->asDecimal($val['principal']+$val['interest']) . '" disabled></td>
                    <td '.$rowspanStr.' class="sy1"><input type="text" fd="is_suit" tb="p" value="' .$is_suit[$val['is_suit']]['name'] . '" disabled></td>
                    <td '.$rowspanStr.' class="sy1"><input type="text" fd="management_status" tb="p" value="' .$managementStatus[$val['management_status']] . '" disabled></td>
                    <td '.$rowspanStr.' class="sy1"><input type="text" fd="enterprise" tb="p" value="' .$projectEnterprise[$val['enterprise']] . '" disabled></td>
                    <td '.$rowspanStr.' class="sy1"><input class="txt-cut" type="text" fd="industry" tb="p" value="' .$industryStr . '" disabled title="' .$industryStr . '"></td>
                    <td '.$rowspanStr.' class="sy1"><input class="txt-cut" type="text" fd="guarantor" tb="p" value="' .$val['guarantor'] . '" disabled title="' .$val['guarantor'] . '"></td>
                    <td '.$rowspanStr.' class="sy1"><input class="txt-cut" type="text" fd="warranty" tb="p" value="' .$val['warranty'] . '" disabled title="' .$val['warranty'] . '"></td>
                    <td '.$rowspanStr.' class="sy1"><input class="txt-cut" type="text" fd="guarantor_status" tb="p" value="' .$val['guarantor_status'] . '" disabled title="' .$val['guarantor_status'] . '"></td>
                    <td '.$rowspanStr.' class="sy1"><input class="txt-cut" type="text" fd="mortgage_details" tb="p" title="' .$val['mortgage_details'] . '" value="' .$val['mortgage_details'] . '" disabled></td>';
                echo  '<td '.$rowspanStr.' class="sy2"><input type="text" fd="judgement" tb="pl" value="' .($val['lawsuit']?$val['lawsuit']['judgement']:''). '" disabled title="' .($val['lawsuit']?$val['lawsuit']['judgement']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy2"><input type="text" fd="execution" tb="pl" value="' .($val['lawsuit']?$val['lawsuit']['execution']:''). '" disabled title="' .($val['lawsuit']?$val['lawsuit']['execution']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy2"><input type="text"fd="court" tb="pl" value="' .($val['lawsuit']?$val['lawsuit']['court']:''). '" disabled title="' .($val['lawsuit']?$val['lawsuit']['court']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy2"><input type="text" fd="block" tb="pl" value="' .($val['lawsuit']?$val['lawsuit']['block']:''). '" disabled title="' .($val['lawsuit']?$val['lawsuit']['block']:'') . '"></td>';

                //抵押物信息 m.mortgage_principal,m.mortgage_interest,s.mortgage_type,s.mortgage_owner,s.mortgage_code,s.mortgage_building_area,s.mortgage_land_area,s.maximum_mortgage,s.remaining_service_life,
                $ifTrStr='';
                $ifTr=0;
                if(count($val['mortgage'])>0){// && $val['mortgage']['seal']
                    $mortgage_array=$val['mortgage'];
                    foreach($mortgage_array as $mortgage){
                        $ifTr++;
                        $rowspanSeal=count($mortgage['seal'])>1?'rowspan="'.count($mortgage['seal']).'"':'';
                        if($ifTr>1){
                            $ifTrStr.= '<tr><td  '.$rowspanSeal.' class="sy3"><input type="text" fd="mortgage_principal" tb="pm" keyId="'.$mortgage['id'].'" value="' . $mortgage['mortgage_principal'] . '" disabled title="' .$mortgage['mortgage_principal'] . '"></td>
                                <td  '.$rowspanSeal.' class="sy3"><input type="text" fd="mortgage_interest" tb="pm" keyId="'.$mortgage['id'].'" value="' . $mortgage['mortgage_interest'] . '" disabled title="' .$mortgage['mortgage_interest'] . '"></td>';
                        }else{
                            echo '<td  '.$rowspanSeal.' class="sy3"><input type="text" fd="mortgage_principal" tb="pm" keyId="'.$mortgage['id'].'" value="' . $mortgage['mortgage_principal'] . '" disabled title="' .$mortgage['mortgage_principal'] . '"></td>
                                <td  '.$rowspanSeal.' class="sy3"><input type="text" fd="mortgage_interest" tb="pm" keyId="'.$mortgage['id'].'" value="' . $mortgage['mortgage_interest'] . '" disabled title="' .$mortgage['mortgage_interest'] . '"></td>';
                        }
                        $ifTrSeal=0;
                        $ifTrSealStr='';
                        if(count($mortgage['seal'])>0) {
                            foreach ($mortgage['seal'] as $seal) {
                                $ifTrSeal++;
                                //获取抵押物类型名称-开始
                                $mortgage_type_str='';//抵押物类型名称（抵押查封中）
                                $mortgage_type=explode(',',$seal['mortgage_type']);
                                foreach ($mortgage_type as $value){
                                    if($value>0){//显示大于零的索引
                                        if($mortgage_type_str) $mortgage_type_str.=',';
                                        $mortgage_type_str.=$mortgageTypes3[$value]['name'];
                                    }
                                }//获取抵押物类型名称-结束
                                if($ifTrSeal>1){
                                    $ifTrSealStr.= '<tr>
                                     <td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="'.$seal['id'].'" value="' . $mortgage_type_str . '" disabled title="' .$mortgage_type_str . '"></td>
                                     <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_owner']. '" disabled title="' .$seal['mortgage_owner'] . '"></td>
                                     <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_code']. '" disabled title="' .$seal['mortgage_code'] . '"></td>
                                     <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_building_area']. '" disabled title="' .$seal['mortgage_building_area'] . '"></td>
                                     <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_land_area']. '" disabled title="' .$seal['mortgage_land_area'] . '"></td>
                                     <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['maximum_mortgage']. '" disabled title="' .$seal['maximum_mortgage'] . '"></td>
                                     <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['remaining_service_life']. '" disabled title="' .$seal['remaining_service_life'] . '"></td>
                                     ';
                                    //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                                    $ifTrSealStr.= '<td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_order']. '" disabled title="' .$seal['mortgage_order'] . '"></td>
                                     <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_mortgage'] == 1|| $seal['is_first_mortgage'] == 2) ? $IsFirstMortgage[$seal['is_first_mortgage']]['name'] : ''). '" disabled></td>
                                    <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_future']. '" disabled title="' .$seal['mortgage_future'] . '"></td>
                                    <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_situation']. '" disabled title="' .$seal['mortgage_situation'] . '"></td>
                                    <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_order']. '" disabled title="' .$seal['mortgage_seal_order'] . '"></td>
                                    <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_seal'] == 1||$seal['is_first_seal']==2) ? $IsFirstSeal[$seal['is_first_seal']]['name'] : ''). '" disabled></td>
                                    <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_state']. '" disabled title="' .$seal['mortgage_seal_state'] . '"></td>
                                    ';
                                    // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                                    $ifTrSealStr.= '
                                    <td  class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_reservation'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_reservation'] : '') . '"></td>
                                    <td  class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_radical'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_radical'] : '') . '"></td>
                                    <td  class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['price_reason'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['price_reason'] : '') . '"></td>
                                    </tr>';
                                }else{
                                    if($ifTr > 1){
                                        $ifTrStr.= '
                                        <td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="'.$seal['id'].'" value="' . $mortgage_type_str . '" disabled title="' .$mortgage_type_str . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_owner']. '" disabled title="' .$seal['mortgage_owner'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_code']. '" disabled title="' .$seal['mortgage_code'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_building_area']. '" disabled title="' .$seal['mortgage_building_area'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_land_area']. '" disabled title="' .$seal['mortgage_land_area'] . '"></td>
                                         <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['maximum_mortgage']. '" disabled title="' .$seal['maximum_mortgage'] . '"></td>
                                         <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['remaining_service_life']. '" disabled title="' .$seal['remaining_service_life'] . '"></td>
                                         ';
                                        //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                                        $ifTrStr.= '
                                        <td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_order']. '" disabled title="' .$seal['mortgage_order'] . '"></td>
                                        <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_mortgage'] == 1|| $seal['is_first_mortgage'] == 2) ? $IsFirstMortgage[$seal['is_first_mortgage']]['name'] : ''). '" disabled></td>
                                        <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_future']. '" disabled title="' .$seal['mortgage_future'] . '"></td>
                                        <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_situation']. '" disabled title="' .$seal['mortgage_situation'] . '"></td>
                                        <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_order']. '" disabled title="' .$seal['mortgage_seal_order'] . '"></td>
                                        <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_seal'] == 1||$seal['is_first_seal']==2) ? $IsFirstSeal[$seal['is_first_seal']]['name'] : ''). '" disabled></td>
                                        <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_state']. '" disabled title="' .$seal['mortgage_seal_state'] . '"></td>
                                        ';
                                        // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                                        $ifTrStr.= '
                                        <td  class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_reservation'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_reservation'] : '') . '"></td>
                                        <td  class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_radical'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_radical'] : '') . '"></td>
                                        <td  class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['price_reason'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['price_reason'] : '') . '"></td>
                                        ';
                                    } else{
                                        echo '
                                         <td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="'.$seal['id'].'" value="' . $mortgage_type_str . '" disabled title="' .$mortgage_type_str . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_owner']. '" disabled title="' .$seal['mortgage_owner'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_code']. '" disabled title="' .$seal['mortgage_code'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_building_area']. '" disabled title="' .$seal['mortgage_building_area'] . '"></td>
                                         <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_land_area']. '" disabled title="' .$seal['mortgage_land_area'] . '"></td>
                                         <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['maximum_mortgage']. '" disabled title="' .$seal['maximum_mortgage'] . '"></td>
                                         <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['remaining_service_life']. '" disabled title="' .$seal['remaining_service_life'] . '"></td>
                                         ';
                                        //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                                        echo '
                                        <td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_order']. '" disabled title="' .$seal['mortgage_order'] . '"></td>
                                        <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_mortgage'] == 1|| $seal['is_first_mortgage'] == 2) ? $IsFirstMortgage[$seal['is_first_mortgage']]['name'] : ''). '" disabled></td>
                                        <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_future']. '" disabled title="' .$seal['mortgage_future'] . '"></td>
                                        <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_situation']. '" disabled title="' .$seal['mortgage_situation'] . '"></td>
                                        <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_order']. '" disabled title="' .$seal['mortgage_seal_order'] . '"></td>
                                        <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="'.$seal['id'].'" value="' . (($seal['is_first_seal'] == 1||$seal['is_first_seal']==2) ? $IsFirstSeal[$seal['is_first_seal']]['name'] : ''). '" disabled></td>
                                        <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="'.$seal['id'].'" value="' . $seal['mortgage_seal_state']. '" disabled title="' .$seal['mortgage_seal_state'] . '"></td>
                                        ';
                                        // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                                        echo '<td class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_reservation'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_reservation'] : '') . '"></td>
                                        <td class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['payment_radical'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['payment_radical'] : '') . '"></td>
                                        <td class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="'.($seal['value']?$seal['value']['id']:'').'" value="' . ($seal['value'] ? $seal['value']['price_reason'] : '') . '" disabled title="' .($seal['value'] ? $seal['value']['price_reason'] : '') . '"></td>
                                        ';
                                    }
                                }
                            }
                        } else{//只有抵押本金木有抵押物时
                            if($ifTr > 1){
                                $ifTrStr.= '<td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="" value="" disabled></td>
                                    ';
                                //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                                $ifTrStr.= '<td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="" value="" disabled></td>
                                   ';
                                // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                                $ifTrStr.='<td class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="" value="" disabled></td>
                                   ';
                            }else{
                                echo '<td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="" value="" disabled></td>
                               <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="" value="" disabled></td>
                                    ';
                                //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                                echo '<td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="" value="" disabled></td>
                                   ';
                                // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                                echo '<td class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="" value="" disabled></td>
                                   <td class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="" value="" disabled></td>
                                   ';
                            }
                        }
                        if($ifTr>1){
                            $ifTrStr.='</tr>';
                        }
                        $ifTrStr.= $ifTrSealStr;
                    }
                }else{//当无抵押本金时
                    echo '<td class="sy3"><input type="text" fd="mortgage_principal" tb="pm" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_interest" tb="pm" keyId="" value="" disabled></td>';
                    echo '<td class="sy3"><input type="text" fd="mortgage_type" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_owner" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_code" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_building_area" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_land_area" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="maximum_mortgage" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="remaining_service_life" tb="ps" keyId="" value="" disabled></td>
                           ';
                    //  抵押查封      s.is_first_mortgage,s.mortgage_future,s.mortgage_seal_order,s.is_first_seal,s.mortgage_seal_state,s.mortgage_order,s.mortgage_situation,
                    echo '<td class="sy3"><input type="text" fd="mortgage_order" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="is_first_mortgage" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_future" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_situation" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_seal_order" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="is_first_seal" tb="ps" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="mortgage_seal_state" tb="ps" keyId="" value="" disabled></td>
                           ';
                    // 抵押物评估    v.payment_reservation as vpayment_reservation,v.payment_radical as vpayment_radical,v.price_reason,
                    echo '<td class="sy3"><input type="text" fd="payment_reservation" tb="pv" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="payment_radical" tb="pv" keyId="" value="" disabled></td>
                           <td class="sy3"><input type="text" fd="price_reason" tb="pv" keyId="" value="" disabled></td>
                           ';
                }
//// 非抵押物评估       ov.bought_analysis,ov.bought_reservation,ov.bought_radical,s.mortgage_other_seal_order,s.mortgage_other_seal_state,
                echo '<td '.$rowspanStr.' class="sy6"><input type="text" fd="bought_analysis" tb="pov" value="' .$val['oValue']['bought_analysis']. '" disabled title="' .$val['oValue']['bought_analysis'] . '"></td>
                    <td '.$rowspanStr.'class="sy6"><input type="text" fd="bought_reservation" tb="pov" value="' .$val['oValue']['bought_reservation']. '" disabled title="' .$val['oValue']['bought_reservation'] . '"></td>
                    <td '.$rowspanStr.'class="sy6"><input type="text" fd="bought_radical" tb="pov" value="' .$val['oValue']['bought_radical']. '" disabled title="' .$val['oValue']['bought_radical'] . '"></td>
                    <td '.$rowspanStr.'class="sy6"><input type="text" fd="mortgage_other_seal_order" tb="pov" value="' .$val['oValue']['mortgage_other_seal_order']. '" disabled title="' .$val['oValue']['mortgage_other_seal_order'] . '"></td>
                    <td '.$rowspanStr.'class="sy6"><input type="text" fd="mortgage_other_seal_state" tb="pov" value="' .$val['oValue']['mortgage_other_seal_state']. '" disabled title="' .$val['oValue']['mortgage_other_seal_state'] . '"></td>
                    ';
// 回现评估     c.payment_reservation,c.payment_radical,c.payment_tax,c.payment_month,c.payment_analysis
                echo '<td '.$rowspanStr.' class="sy7"><input type="text" fd="payment_reservation" tb="pp" value="' .($val['payment']?$val['payment']['payment_reservation']:''). '" disabled title="' .($val['payment']?$val['payment']['payment_reservation']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy7"><input type="text" fd="payment_radical" tb="pp" value="' .($val['payment']?$val['payment']['payment_radical']:''). '" disabled title="' .($val['payment']?$val['payment']['payment_radical']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy7"><input type="text" fd="payment_tax" tb="pp" value="' .($val['payment']?$val['payment']['payment_tax']:''). '" disabled title="' .($val['payment']?$val['payment']['payment_tax']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy7"><input type="text" fd="payment_month" tb="pp" value="' .($val['payment']?$val['payment']['payment_month']:''). '" disabled title="' .($val['payment']?$val['payment']['payment_month']:'') . '"></td>
                    <td '.$rowspanStr.' class="sy7"><input type="text" fd="payment_analysis" tb="pp" value="' .($val['payment']?$val['payment']['payment_analysis']:''). '" disabled title="' .($val['payment']?$val['payment']['payment_analysis']:'') . '"></td>
                    ';
                echo '</tr>';
                echo $ifTrStr;
            }
        }else{
        echo '<tr><td colspan=46 style= "width: 1126px; " class= "text-center" >暂无数据</td></tr>';
        }
        ?>
        </tbody>
    </table>
</div>
<!-- 表格结束 -->
<ul class="table-foot-ul ">
    <li class="pull-left" style="margin-left: 12px;">
        <input type="checkbox" id="check2"  class="select-on-check-all pull-left" style="width: 20px; margin-top: 2px;" name="selection_all_dy" value="1">
    </li>
    <li class="pull-left"><label for="check2">全选</label></li>
    <?php
    if(DtActionFilter::checkPackage('package_edit', Yii::$app->session->get('packageid')))
        echo '
        <li class="pull-left asset-package-editing-adds" typeid="2">新增</li>
        <li class="pull-left del-projects">删除</li>
        <li class="pull-left asset-package-editing-down" typeid="2">下载</li>
        <li class="pull-left asset-package-editing-move" typeid="1">移动到混合类列表</li>
        ';
    ?>
    <li class="pull-left asset-package-editing-calculate" typeid="2">计算求和</li>
    <li class="pull-left asset-package-editing-filtrate" typeid="2">高级筛选</li>
    <li class="pull-left table-foot-turn" onclick="onlyShowLight(this)" typeid="2">
        <img src="/image/assetPackage/<?php echo $highlightsPic;?>" class="pull-left" style="margin-top: 17px; margin-right: 5px;">
        <span class="pull-left">只显示亮点项目</span>
    </li>
</ul>
<div class="pagingBox">
    <?PHP
    echo LinkPager::widget([
        'pagination' => $pagesDY,
        'firstPageLabel' => '首页',
        'lastPageLabel' => '尾页',
        'nextPageLabel' => '下一页',
        'prevPageLabel' => '上一页'
    ]);
    ?>
    <div style="float: right;margin: 20px;">
        <!--                <form action="--><?php //echo $_SERVER['REQUEST_URI'] ;?><!--"  method="get" class="pageTotal" id="pageSizeForm">-->
        <span class="lf">每页显示</span>
        <select class="pane" name="per-page-dy" getVal="<?php echo http_build_query(Yii::$app->request->get());?>" id="per-page-dy">
            <option value="10" <?php echo $pagesDY->pageSize==10?'selected':'';?>>10</option>
            <option value="20" <?php echo $pagesDY->pageSize==20?'selected':'';?>>20</option>
            <option value="30" <?php echo $pagesDY->pageSize==30?'selected':'';?>>30</option>
            <option value="40" <?php echo $pagesDY->pageSize==40?'selected':'';?>>40</option>
            <option value="50" <?php echo $pagesDY->pageSize==50?'selected':'';?>>50</option>
        </select>条
        <!--                </form>-->
        <span class="totalSize">共<?php echo $pagesDY->totalCount;?></span>条记录
    </div>
</div>
<style>
    .pagingBox >.pagination{left: 20%; position: absolute;margin: 20px 0px;}
    .fancyTable tr{background: #fff;}
    .fancyTable tr th{color: #999; line-height: 30px;}
    .fancyTable tr td{ padding: 8px 6px; color: #999; line-height: 31px;}
    .fancyTable tr td.sy2,.fancyTable  tr th.sy2{width: 152px!important;}
    .fancyTable tbody tr td:first-child div{width: 50px; margin:0 auto;}
    .fancyTable tbody tr td:first-child div input{border: none; width: 16px; margin-left: 8px;}
    .fancyTable tbody tr td:first-child div input,.fancyTable tbody tr td:nth-child(2) div input,.fancyTable tbody tr td:nth-child(3) input,.fancyTable tbody tr td:nth-child(4)  input{color: #333;}
    .fancyTable tbody tr td:first-child div input:first-child{margin-top: 10px;}
    .fancyTable tbody tr td:nth-child(2) div{width: 180px; }
    .fancyTable tbody tr td:nth-child(2) div input{border: none; margin-left: 8px;}
    .fancyTable tbody tr td:nth-child(2) div img{margin-top: 11px;}
    .fancyTable thead tr th{background: #fff!important;}
</style>
<script>
    //$("#projectListBase2 table td").
    <?php $tabID=$tabID==4||$tabID==5?3:$tabID;?>
    for(var i=1 ;i<8;i++){
        if(i==<?php echo $tabID;?>){
            $("#projectListBase2 table tr .sy"+i).show();
        }else {
            $("#projectListBase2 table tr .sy"+i).hide();
        }
    }
</script>

<script type="text/javascript">
    $(function(){
        // $("#projectListBase2").scrollLeft(200);
         // $("#projectListBase2").scroll(function(){
         //        var l = $("#projectListBase2").scrollLeft();
         //        console.log(l);
         // });
    });
</script>



